﻿using System;
using System.Web.Mvc;

namespace Avalon.Core.MVC.Attributes
{
    [AttributeUsage(AttributeTargets.Property)]
    public class OrderAttribute : Attribute, IMetadataAware
    {
        public int Order { get; set; }
        public OrderAttribute(int order)
        {
            Order = order;
        }

        public void OnMetadataCreated(ModelMetadata metadata)
        {
            metadata.Order = Order;
        }
    }
}
